<template>
	<view class="order_modal">
		<view class="tc_content">
			<view class="title">{{modal_title}}</view>
			<view class="desc_text" v-if="!reason_time">{{order_con}}</view>
			<view class="desc_text" v-if="reason_time">
				亲，您的订单将在<u-count-down :timestamp="reason_time" :show-days="true" separator="zh" font-size="26" separator-size="26" color="#F97632" separator-color="#F97632"></u-count-down>后
				即将过期，请尽快上传凭证哦~
			</view>
			<view class="upload_btn" v-if="reason_time" @click="handleOpenUpload()"><text>去上传凭证</text></view>
		</view>
		<!--<view class="close_icon" @click="handleCloseModal()">
			<image src="@/static/group/close_icon.png" alt=""></image>
		</view>-->
	</view>
</template>

<script>
	export default {
		name: "order_modal",
		props: {
			modal_show: {
				type: Boolean,
				default: false
			},
			minTime: {
				type: Number,
				default: 0
			},
			modal_title: {
				type: String,
				default: ''
			},
			comment_rule: {
				type: String,
				default: ''
			},
			listID: {
				type: Number,
				default: 0
			},
			order_con: {
				type: String,
				default: null
			}
		},
		data() {
			return {
				reason_time: ''
			};
		},
		watch: {
			minTime(newVAl, oldVal) {
				this.reason_time = newVAl
			}
		},
		created() {
			this.reason_time = this.minTime
			// this.handleListTime(this.minTime)
		},
		methods: {
			handleOpenUpload() {
				this.handleCloseModal()
				uni.navigateTo({
					url: '/pages_order/order_voucher?id=' + this.listID + '&comment_rule=' + this.comment_rule
				})
			},
			handleCloseModal() {
				this.$emit('handleCloseModal', false)
			},
		}

	}
</script>

<style lang="scss">
	image {
		width: 100%;
		height: 100%;
	}

	.order_modal {
		/*position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, .4);
		z-index: 9999;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;*/

		.tc_content {
			//width: 80%;
			background-color: #fff;
			border-radius: 16rpx;
			box-sizing: border-box;
			padding: 0 30rpx;

			.title {
				font-size: 36rpx;
				color: #000;
				font-weight: bold;
				box-sizing: border-box;
				padding: 25rpx;
				border-bottom: 2rpx solid #F3F3F3;
				text-align: center;
			}

			.desc_text {
				box-sizing: border-box;
				padding: 50rpx;
				font-size: 28rpx;
				color: #333;
				text-align: center;
				line-height: 56rpx;

				text {
					color: #FC4F18;
				}
			}

			.upload_btn {
				box-sizing: border-box;
				padding-top: 30rpx;
				border-top: 2rpx solid #F3F3F3;

				text {
					width: 240rpx;
					height: 64rpx;
					background: linear-gradient(270deg, #FEB85A 0%, #FC754A 100%);
					border-radius: 100rpx;
					font-size: 28rpx;
					color: #fff;
					line-height: 64rpx;
					text-align: center;
					margin: 0 auto 30rpx;
					display: block;
				}
			}
		}

		.close_icon {
			width: 52rpx;
			height: 52rpx;
			margin-top: 34rpx;
		}
	}
</style>
